﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int main() {
    for (int num = 100; num < 1000; num++) {
        char str_num[4];
        sprintf(str_num, "%d", num);
        int left = num * num;
        char result_str[7];
        sprintf(result_str, "%d", left);
        if (strlen(result_str) == 6 && str_num[0] == result_str[0] && str_num[1] == result_str[2] && str_num[2] == result_str[4]) {
            printf("%d\n", num);
        }
    }
    return 0;
}